#include "heap.h"
#include <iostream>
#include <ctime>
#include <cassert>
using namespace std;

const int NUM = 10000;
int heap[NUM+1];
int size;

void generateRandData (int size)
{
	assert(size <= NUM);
	srand(time(NULL));
	int i;
	for (i = 1; i <= size; i ++)
		heap[i] = rand()%100;
}
int main ()
{
	size = 20;
	generateRandData(size);
	int i;
	buildHeap(heap, size);
	while ( size )
	{
		printf("%d ", deleteMin(heap, size));
	}
	putchar('\n');

	for (i = 0; i < 20; i ++)
	{
		insert(heap, size, rand()%100);
	}
	printHeap(heap, size);
	while ( size )
	{
		printf("%d ", deleteMin(heap, size));
	}
	putchar('\n');

	return 0;
}